<template>
<div>
   <el-form :inline="true">
     <el-form-item >
        <el-button
          type="primary"
          @click="flush"
          icon="export"
        >重新汇总</el-button>
      </el-form-item>
    </el-form>
    <BrowseDataList :cate="cate" :name="name" :cols="cols"/>
    
</div>
</template>
<script>
import { setSaveAfter2019 } from "@/api/案例分析.js";
import { showLoading, hideLoading } from "@/utils/loading"
import BrowseDataList from "@/components/BrowseDataList";
import { getUser } from "@/utils/auth";
import { getJfzc } from "@/api/经费支出.js";
export default {
  components: {
    BrowseDataList
  },
    data() {
    return {
      cate: "经费支出",
      name:"5.2 经费支出",
      cols: [
        { label: "学院总支出（万元）", prop: "XXZZC" },
        {
          label: "其中",
          prop: "学院总支出_其中",
          data: [
            { label: "征地（万元）", prop: "ZDJF" },
            { label: "基础设施建设（万元）", prop: "JCSSJSJF" },
            {
              label: "设备采购（万元）",
              prop: "设备采购",
              data: [
                { label: "合计", prop: "SBCGF" },
                {
                  label: "其中：教学科研仪器设备值",
                  prop: "JXKYYQSBCGF"
                }
              ]
            },
            {
              label: "日常教学经费（万元）",
              prop: "日常教学经费",
              data: [
                { label: "合计", prop: "RCJXJF" },
                {
                  label: "其中",
                  prop: "日常教学经费_其中",
                  data: [
                    { label: "实（验）训耗材", prop: "SYXHCJF" },
                    { label: "实习专项", prop: "SXZXJF" },
                    { label: "聘请兼职教师经费", prop: "PQJZJSJF" },
                    { label: "体育维持费", prop: "TYWCF" },
                    { label: "其他", prop: "QTRCJXJF" }
                  ]
                }
              ]
            },
            { label: "教学改革及研究合计（万元）", prop: "JXGGJYJF" },
            { label: "师资建设合计（万元）", prop: "SZJSJF" },
            { label: "图书购置费（万元）", prop: "TSGZF" },
            { label: "其他支出总额（万元）", prop: "QTZCZE" }
          ]
        },

        { label: "还贷金额（万元）", prop: "HDJE" }
      ]
    };
  },
 
  methods: {
     async flush() {
    try {
      showLoading();
      var user = getUser();
      await setSaveAfter2019(user.XXID, user.CJPC);
      hideLoading();
    } catch (e) {
      this.$alert(e);
    }
  },
    async fetchData() {
      var user = getUser();
      var datas = await getJfzc(user.XXID,user.CJPC);
      return datas;
    },
  }
}
</script>